package com.leyou.item.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.leyou.dto.CategoryDTO;

import com.leyou.entity.Category;
import com.leyou.item.mapper.CategoryMapper;
import com.leyou.item.service.CategoryService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper,Category> implements CategoryService {
    @Override
    public List<CategoryDTO> queryCategoryByPid(Long pid) {
        List<Category> categorys = query().eq("parent_id", pid).list();

        return CategoryDTO.convertEntityList(categorys);
    }
}
